{% extends './layout.html' %}

{% block title -%}
{{post.title}} - {{options.title}}
{%- endblock %}

{% block headers -%}
<link rel="canonical" href="{{site_url}}/post/{{post.pathname}}.html" />
{%- endblock %}

{% block content %}
<div id="page-post">
    <article class="post detail">
        <div class="meta">
            <div class="date">{{think.datetime(post.create_time, 'MM月DD, YYYY')}}</div>
        </div>
        <h1 class="title">{{post.title}}</h1>
        <div class="entry-content">
            {{post.content | replace(r/(<img src="([^"]+)" alt="([^"]*)"\s?\/?>)/g, '<img class="lazy-load" src="" data-src="$2" alt="$3"><noscript>$1</noscript>') | safe}}
        </div>
        <p>本文链接：<a href="{{site_url + ctx.url | safe}}">{{site_url + ctx.url | safe}}</a></p>
        <p>-- <acronym title="End of File">EOF</acronym> --</p>

        <div class="post-info">
            <p>
                作者
                {% set user = post.user %}
                <a href="/author/{{user.name}}" data-user="{{user.display_name}}">
                    <code class="notebook">{% if user.display_name %}{{user.display_name}}{% else %}{{user.name}}{% endif %}</code>
                </a>

                发表于
                <i>{{think.datetime(post.create_time)}}</i>

                {% if post.cate.length %}
                ，添加在分类
                {% for cate in post.cate %}
                <a href="/cate/{{cate.pathname}}" data-cate="{{cate.name}}">
                    <code class="notebook">{{cate.name}}</code>
                </a>
                {% endfor%}
                下
                {% endif %}

                {% if post.tag.length %}
                ，并被添加「
                {% for tag in post.tag %}
                <a href="/tag/{{tag.pathname}}" data-tag="{{tag.name}}">
                    <code class="notebook">{{tag.name}}</code>
                </a>
                {% endfor %}
                 」标签
                {% endif %}

                ，最后修改于
                <i>{{think.datetime(post.update_time)}}</i>
            </p>
            {% if themeConfig.cc %}
            <p>{{themeConfig.cc | safe}}</p>
            {% endif %}
        </div>
    </article>
    {%if post.prev.title or post.next.title %}
        <nav class="pagination">
            {% if post.prev.title %}
                <a href="/post/{{ post.prev.pathname }}.html" class="prev">&laquo; {{ post.prev.title }}</a>
            {% endif %}

            {% if post.next.title %}
                <a href="/post/{{ post.next.pathname }}.html" class="next">{{ post.next.title }} &raquo;</a>
            {% endif %}
        </nav>
    {% endif %}
    {% if post.allow_comment %}
        {% include "./inc/comment.html" %}
    {% endif %}
</div>
{% endblock %}
